package com.neusoft.elmboot.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.elmboot.po.BankCard;
import com.neusoft.elmboot.service.BankCardService;

@RestController
@RequestMapping("/BankCard")
public class BankCardController {
	@Autowired
	private BankCardService bankCardService;
	
	@PostMapping("/CardId")
	public int saveBankCard(BankCard bankCard) throws Exception{
		return bankCardService.saveBankCard(bankCard);
	}
	
	@GetMapping("/WalletId")
	public List<BankCard> listBankCardByWalletId(BankCard bankCard) throws Exception{
		return bankCardService.listBankCardByWalletId(bankCard.getWalletId());
	}

}
